<?php
include ('../model/connect.php');
include ('../model/Staff/class-staff.php');
session_start();

$staffname = $_POST['staffname'];
$staffpass = $_POST['staffpass'];
$staff = new Staff();


if($staff->checkLogin($staffname,$staffpass) == true){
    $_SESSION["username"] = $staffname;
    $_SESSION["staffname"] = $staffname;
    header("location:http:/educational/staff-index.php?p=staffhome");
}else{
    $_SESSION["error"] = "<script>alert(\"Login error !!!\");</script>";
    header("location:http:/educational/index.php");
}

mysql_close($conn);


?>